//5.4 - The Conquest Game - Dirk Henkemans - Prima Publishing #include #include using namespace std; //handles each nation for each player class Nation { public: int land; int troops; private: string name; int food; int gold; int people; int farmers; int merchants; int blacksmiths; public: Nation(string lName); Nation(); bool takeTurn(void); private: void menu(void); }; Nation nation1; Nation nation2; //sets the default nation values Nation::Nation(string lName) : name(lName), land(20), food(50), troops(15), gold(100), people(100), farmers(0), merchants(0), blacksmiths(0) { } //a default constructor Nation::Nation() { } //takes a turn for player bool Nation::takeTurn() { cout<<"Its now "<>input; switch (input) { case 1: //buys land cout<<"You buy "< nation2.troops) { nation2.land -= 10; nation1.land += 10; } nation1.troops = 0;//war is bloody thing!!! nation2.troops = 0; break; case 6:return; //ends the turn } } } //the main game funtion int main(void) { string tempString; cout<<"Welcome to the Conquest \n"; cout<<"What is your name player 1? \n"; cin>>tempString; nation1 = Nation(tempString); cout<<"What is your name player 2? \n"; cin>>tempString; nation2 = Nation(tempString); while(nation1.takeTurn() && nation2.takeTurn()) { } return 0; }